package br.com.caelum.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionFactory 
{
	public Connection getConnection()
	{
		System.out.println("Conectando ao banco");
		
		try
		{
			DriverManager.registerDriver(new org.gjt.mm.mysql.Driver());
			return DriverManager.getConnection("jdbc:mysql://localhost:3306/fj21", "root", "root");
		}
		catch(SQLException e)
		{
			throw new RuntimeException(e);
		}
	}
}
